package com.cloudcentral.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloudcentral.entity.Platform;

/**
 * <p>
 * 系统平台表 Mapper 接口
 * </p>
 *
 * @author Administrator
 * @since 2023-10-27
 */
public interface PlatformBaseMapper extends BaseMapper<Platform> {
  default Platform getByName(String name) {
    QueryWrapper<Platform> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("name", name);
    return selectOne(queryWrapper);
  }

  default Platform getByCode(String code) {
    QueryWrapper<Platform> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("code", code);
    return selectOne(queryWrapper);
  }

  default Platform getByURI(String uri) {
    QueryWrapper<Platform> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("uri", uri);
    return selectOne(queryWrapper);
  }
}
